package com.parking.status.sync.netty.client;

import com.parking.status.sync.netty.entity.RequestPre;
import com.parking.status.sync.netty.util.PojoMapper;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;

import java.util.List;

/**
 * Created by Administrator on 2015/9/18.
 */
public class RequestBodyEncoder extends MessageToMessageEncoder<RequestPre> {
    @Override
    protected void encode(ChannelHandlerContext channelHandlerContext, RequestPre content, List<Object> out) throws Exception {
        String json = PojoMapper.toJson(content);
        out.add(json);
    }
}
